package com.ma.server.Impl;

import com.ma.Dao.StudentDao;
import com.ma.server.StudentServer;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


/**
 * @ProjectName: project
 * @Package: com.ma.server.Impl
 * @ClassName: StudentServerImpl
 * @Author: YHHHH
 * @Description:
 * @Date: 2021/3/12 16:43
 * @Version: 1.0
 */
@Service
@Transactional
public class StudentServerImpl implements StudentServer {

    @Autowired
    private StudentDao studentDao;

    @Override
    public Integer updateStudentTeam(String studentNumber, Integer teamID,Integer state) {
        Integer integer = studentDao.updateStudentTeam(studentNumber, teamID,state);
        return integer;
    }

    @Override
    public Integer findTeamID(String id) {
        Integer teamID = studentDao.findTeamID(id);
        return teamID;
    }

    @Override
    public Integer updateImage(String number, String url) {
        Integer integer = studentDao.updateImage(number, url);

        return integer;
    }

    @Override
    public Integer updateData(String number, String phone, String email) {
        Integer integer = studentDao.updateData(number, phone, email);
        return integer;
    }

    @Override
    public Integer updateLeader(String number) {
        Integer integer = studentDao.updateLeader(number);

        return integer;
    }

    @Override
    public Integer updateNoLeader(String number) {
        Integer integer = studentDao.updateNoLeader(number);

        return integer;
    }

    @Override
    public List<String> findAllTeammate(Integer teamId) {
        List<String> allTeammate = studentDao.findAllTeammate(teamId);
        return allTeammate;
    }

    @Override
    public List<String> findAllTeammateNum(Integer id) {
        List<String> allTeammateNum = studentDao.findAllTeammateNum(id);
        return allTeammateNum;
    }

    @Override
    public Integer findMajor(String number) {
        Integer major = studentDao.findMajor(number);
        return major;

    }

    @Override
    public Integer updateScore(Integer score, String number) {
        Integer integer = studentDao.updateScore(score, number);
        return integer;

    }
}
